home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-07-24 | 5.6 KB | 147 lines | [TEXT/CWIE] |
-
- /**************** Resource format Constants **************/
-
- const OSType kAXObjInfoResType = 'OInf'; // Object Info Resource Type
- const short kAXObjInfoStart = 128; // Resource number for axID resources
- const OSType kAXMethListResType = 'Mth#'; // Method List Resource Type
- const short kAXMethResIDStart = 128; // Starting resource number for method list resources
- const OSType kAXParamListResType = 'Prm#'; // Parameter List Resource Type
- const short kAXParamResIDStart = 128; // Starting resource number for param list resources
-
- // String indexes in the STR# resource pointed to by the InfoRsrc.StringListResID
- enum
- {
- kAXClassIDStrIndex = 1, // Index in STR# resource that holds the class id
- kAXUserNameStrIndex = 2, // Index in STR# resource that holds the User Name
- kAXProgIDStrIndex = 3, // Index in STR# resource that holds the ProgID
- kAXFragNameStrIndex = 4, // Index in STR# resource that holds the Frag Name
- kAXCodeBaseExtIndex = 5 // Index in STR# resource that holds the Codebase extension
- };
-
- typedef Str255 AXRsrcName;
-
- // Object Info resource
- typedef struct
- {
- Uint16 StringListResID; // Res ID of string list resource that holds strings
- Uint16 MimeListResID; // Res ID of string list resource that holds mime strings
- Uint32 DefaultHeight; // Default Height
- Uint32 DefaultWidth; // Default width
- Uint32 UnusedLongs[6]; // Unused space at end
- }
- AXInfoRsrc, **AXInfoRsrcHdl;
-
- // Method description resource
- typedef struct
- {
- Uint32 Unused[4]; // Unused space for future expansion
- DISPID DispID; // Invocation ID
- AXMethodKind Kind; // property, method or event
- Uint16 ParamsResID; // Rsrc ID of parameter list (value list for properties)
- VARTYPE ReturnType; // Return Type
- Uint16 Size; // Total size of this member
- AXRsrcName Name; // Name of the method ( or property name )
- }
- AXMethodRsrc, *AXMethodRsrcPtr, **AXMethodRsrcHdl;
-
- // Method Description List resource
- typedef struct
- {
- Uint32 Unused[4]; // Unused space for future expansion
- Uint16 Unused5; // Unused word for future expansion
- Uint16 InIIDRes; // Res ID of IID resource for default incoming dispatch interface (0 for IDispatch)
- Uint16 OutIIDRes; // Res ID of IID resource for default outgoing dispatch interface (0 for IDispatch)
- Uint16 NumMethods; // Number of methods in the method list
- AXMethodRsrc MethodRsrc[1]; // List of method descriptions
- }
- AXMethodListRsrc, *AXMethodListRsrcPtr, **AXMethodListRsrcHdl;
-
-
- // Parameter Description Resource
- typedef struct
- {
- Uint32 Unused[4]; // Unused space for future expansion
- VARTYPE Type; // Type of parameter - VARIANT mapping
- Uint16 Size; // Size of this member
- AXRsrcName Name; // Method param name, property string value
- }
- AXParamRsrc, *AXParamRsrcPtr;
-
- // Parameter Description List Resource
- typedef struct
- {
- Uint32 Unused[4]; // Unused space for future expansion
- Uint16 ValueIndex; // 1-based Index in list of the property value parameter, 0 for methods and events
- Uint16 ParamCount; // Number of parameters in the list
- AXParamRsrc ParamRsrc[1]; // Param Descriptions
- }
- AXParamListRsrc, *AXParamListRsrcPtr, **AXParamListRsrcHdl;
-
-
-
- class CObjectDesc :
- public CBaseCOM,
- public IObjectInfo,
- public IObjectDesc
- {
- public:
- // *** CObjectDesc methods ***
- CObjectDesc(void);
- CObjectDesc(AXPlatformFileRef inRef);
- ~CObjectDesc(void);
-
- // *** IUnknown methods ***
- STDMETHOD (QueryInterface) (THIS_ REFIID inRefIID, void **outObj);
- STDMETHOD_(Uint32,AddRef) (THIS) { return CBaseCOM::AddRef(); }
- STDMETHOD_(Uint32,Release) (THIS) { return CBaseCOM::Release(); }
-
- // **** IObjectInfo methods ***
- STDMETHOD (GetClassID) (THIS_ CLSID* outID );
- STDMETHOD (GetIDString) (THIS_ AXIDKind inKind, Uint32 inBufferSize, char* outStringID);
- STDMETHOD (GetDefaultSize) (THIS_ AXPlatformPoint* outDefaultSize);
-
- // **** IObjectDesc methods ***
- STDMETHOD (GetInterfaceID) (THIS_ AXMethodKind inKind, IID* outID) ;
- STDMETHOD_(Uint32, GetCount) (THIS_ AXMethodKind inKind) ;
- STDMETHOD (GetMethodDesc) (THIS_ AXMethodKind inKind, Uint32 inIndex, AXMethodDesc* outDesc ) ;
-
- // *** IPropertyBag methods ***
- STDMETHOD(Read) (THIS_ LPCOLESTR inPropName, LPVARIANT outVariant, LPERRORLOG ioErrorLog);
- STDMETHOD(Write) (THIS_ LPCOLESTR inPropName, LPVARIANT inVariant);
-
- STDMETHOD_(Int16,GetMimeResID) (THIS) {return mMimeListResID;}
-
- protected:
- // *** members ***
- CLSID mClassID; // Class ID for this object
- AXRsrcName mClassIDStr; // String representation of ClassID
- AXRsrcName mUserName; // String representation of UserName
- AXRsrcName mProgID; // String representation of ProgID
- AXRsrcName mFragName; // String representation of fragment name
- AXRsrcName mCodebaseExt; // String that holds the codebase extension of the control
- Uint32 mDefaultHeight; // Default height of the object
- Uint32 mDefaultWidth; // Default width of the object
- Int16 mMimeListResID; // MimeListResID from the Object Info Resource
-
- IID mInDispatch; // Incoming IDispatch IID
- IID mOutDispatch; // Outgoing IDispatch IID
- LArray* mProps; // List of properties
- LArray* mMethods; // List of methods
- LArray* mEvents; // List of events
-
- Boolean mObjectInfoLoaded; // True if axID resource has been loaded
- Boolean mObjectDescLoaded; // true if object description resources have been loaded
-
- // *** methods ***
- void AddMethodDesc(Int16 inIndex, AXMethodDesc* inDesc);
- void CopyMethodRsrcToDesc(AXMethodRsrcPtr MethodRsrcP, AXMethodDesc* inDesc);
- void DestroyDescs(LArray* inDescs);
- void GetDesc(LArray* inDescs, Uint16 inIndex, AXMethodDesc* outDesc);
- void Initialize(void);
- AXErrorCode ReadObjectInfo (AXPlatformFileRef inRef);
- AXErrorCode ReadObjectDesc (AXPlatformFileRef inRef);
-
- };
-
-
-